package com.ksyun.ks3.demo;

import com.ksyun.ks3.service.request.CopyObjectRequest;

/**
 * @author lijunwei[lijunwei@kingsoft.com]  
 * 
 * @date 2014年12月1日 下午1:49:48
 * 
 * @description copy object,经常用来重命名文件名
 **/
public class CopyObjectDemo extends AbstractDemo{
	public void copyObject(){
		/**将sourceBucket这个存储空间下的sourceKey这个object复制到destinationBucket这个存储空间下，并命名为destinationObject
		 */
		CopyObjectRequest request = new CopyObjectRequest("destinationBucket","destinationObject","sourceBucket","sourceKey");
		client.copyObject(request);
	}
	/**
	 * 重命名object
	 */
	public void renameObject(){
		/**将sourceBucket这个存储空间下的sourceKey这个object重命名为destinationObject
		 */
		CopyObjectRequest request = new CopyObjectRequest("sourceBucket","destinationObject","sourceBucket","sourceKey");
		client.copyObject(request);
	}
}
